home *** CD-ROM | disk | FTP | other *** search
- Path: news.jhu.edu!news
- From: Chenyang Xu <chenyang@mashie.ece.jhu.edu>
- Newsgroups: comp.lang.c
- Subject: about free()
- Date: Tue, 27 Feb 1996 11:41:56 -0500
- Organization: ECE Department, The Johns Hopkins University
- Message-ID: <31333454.167E@mashie.ece.jhu.edu>
- NNTP-Posting-Host: 128.220.14.190
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.2 IP22)
-
- Hi, there,
-
- I have a simple question here.
-
- I have a function say newarrary() which mallocs an array inside and
- returns a pointer to this arrary. In another function foo.c, the result
- of newarray() is assigned to a pointer ptr. Now after some operations on
- this array. I use free(ptr) to free the memory allocated by newarrary().
- My question is whould this cause a problem, since free() is not freeing
- the same pointer which is allocated by the malloc() although this
- pointer point to the same memory.
-
- --
- Chenyang
-
- \\|//
- (o o)
- --------------------------ooO-(_)-Ooo----------------------------------
- (o) 410-516-6819 | Fax:410-516-5566
- chenyang@jhu.edu | http://iacl.ece.jhu.edu/~chenyang
- _________________________________________________________
- / Image Analysis and Communication Lab /
- / Department of the Electric and Computer Engineering /
- / The Johns Hopkins University /
- / Baltimore, MD 21218 /
- =======================================================================
-